import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  base:'./',
  server:{
    port:9427,
    open:true,
    proxy:{
      "/upload":{
        target: 'http://localhost:9527',
        changeOrigin: true,
        //rewrite: (path) => path.replace(/^\/upload/, ''),
      }
    }
  },
  build:{
    outDir:'views',
    assetsDir:'./'
  },
  plugins: [
    vue(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
